
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel=stylesheet href='include/hoj.css' type='text/css'>
</head>
<body>
<center>
<div style="width:90%; text-align:left">
<img src="image/logo.png"/>
</div>
<table width=96%> 
	<tr align="center" class='hd' valign="top">
				<th><a href="faqs.php">F.A.Qs</a></th>
		<th><a href="./bbs.php">Web Board</a></th>
		<th><a href="./">Home</a></th>
		<th><a href="./problemset.html">ProblemSet</a></th>
		<th><a href="./status.php">Status</a></th>
		<th><a href="./ranklist.php">Ranklist</a></th>
		<th><a href="./contest.php">Contest</a></th>
		<th><a href=loginpage.php>Login</a></th><th><a href=registerpage.php>Register</a></th>	</tr>
</table>
</center>
<center>
<div class="notice">
	<div>
		<B>Notice:</B>鉴于种种原因，本OJ自下周星期一（3月5号）开始不再全面开放，请各位做好善后事宜，谢谢合作。	</div>
</div>
</center>
</div>
<title>Problem 2021. -- [Usaco2010]Cheese Towers 
</title><center><h2>2021: [Usaco2010]Cheese Towers 
</h2><span class=green>Time Limit: </span>4 Sec&nbsp;&nbsp;<span class=green>Memory Limit: </span>64 MB<br><span class=green>Submit: </span>102&nbsp;&nbsp;<span class=green>Solved: </span>60<br>[<a href='submitpage.php?id=2021'>Submit</a>][<a href='problemstatus.php?id=2021'>Status</a>][<a href='bbs.php?id=2021'>Discuss</a>]</center><h2>Description</h2><div class=content>Farmer John wants to save some blocks of his cows' delicious Wisconsin
cheese varieties in his cellar for the coming winter. He has room
for one tower of cheese in his cellar, and that tower's height can
be at most T (1 <= T <= 1,000). The cows have provided him with a
virtually unlimited number of blocks of each kind of N (1 <= N <=
100) different types of cheese (conveniently numbered 1..N). He'd
like to store (subject to the constraints of height) the most
valuable set of blocks he possibly can. The cows will sell the rest
to support the orphan calves association.

Each block of the i-th type of cheese has some value V_i (1 <= V_i
<= 1,000,000) and some height H_i (5 <= H_i <= T), which is always
a multiple of 5.

Cheese compresses. A block of cheese that has height greater than
or equal to K (1 <= K <= T) is considered "large" and will crush
any and all of the cheese blocks (even other large ones) located
below it in the tower. A crushed block of cheese doesn't lose any
value, but its height reduces to just 4/5 of its old height. Because
the height of a block of cheese is always a multiple of 5, the
height of a crushed block of cheese will always be an integer. A
block of cheese is either crushed or not crushed; having multiple
large blocks above it does not crush it more. Only tall blocks of
cheese crush other blocks; aggregate height of a tower does not
affect whether a block is crushed or not.

What is the total value of the best cheese tower FJ can construct?

Consider, for example, a cheese tower whose maximum height can be
53 to be build from three types of cheese blocks. Large blocks are
those that are greater than or equal to 25. Below is a chart of the
values and heights of the various cheese blocks he stacks:

           Type    Value      Height
             1      100         25
             2       20          5
             3       40         10

FJ constructs the following tower:

            Type Height Value
      top -> [1]   25    100
             [2]    4     20   <- crushed by [1] above
             [3]    8     40   <- crushed by [1] above
             [3]    8     40   <- crushed by [1] above
   bottom -> [3]    8     40   <- crushed by [1] above

The topmost cheese block is so large that the blocks below it are
crushed. The total height is:

        25 + 4 + 8 + 8 + 8 = 53

The total height does not exceed 53 and thus is 'legal'. The total
value is:

       100 + 20 + 40 + 40 + 40 = 240.

This is the best tower for this particular set of cheese blocks.

John要建一个奶酪塔，高度最大为T。他有N块奶酪。第i块高度为Hi（一定是5的倍数），价值为Vi。一块高度>=K的奶酪被称为大奶酪，一个奶酪如果在它上方有大奶酪（多块只算一次），它的高度就会变成原来的4/5.。。
很显然John想让他的奶酪他价值和最大。。
求这个最大值。。
</div><h2>Input</h2><div class=content>第一行分别是 N T K
接下来N行分别是
Vi Hi
</div><h2>Output</h2><div class=content>一行最大值

</div><h2>Sample Input</h2>
			<div class=content><span class=sampledata>3 53 25<br />
100 25<br />
20 5<br />
40 10<br />
<br />
<br />
<br />
</span></div><h2>Sample Output</h2>
			<div class=content><span class=sampledata>240<br />
</span></div><h2>HINT</h2>
			<div class=content><p></p></div><h2>Source</h2>
			<div class=content><p><a href='problemset.html?search=Silver'>Silver</a></p></div><center>[<a href='submitpage.php?id=2021'>Submit</a>][<a href='problemstatus.php?id=2021'>Status</a>][<a href='bbs.php?id=2021'>Discuss</a>]</center>﻿<br>

<a href="./"><span class=red>HOME</span></a>
<a href="javascript:history.go(-1)"><span class=red>Back</span></a>

<hr>
<center>
	<div class="footer">
			<a href=setlang.php?lang=ko>한국어</a>&nbsp;
		<a href=setlang.php?lang=cn>中文</a>&nbsp;
		<a href=setlang.php?lang=fa>فارسی</a>&nbsp;
		<a href=setlang.php?lang=en>English</a>&nbsp;
		<a href=setlang.php?lang=th>ไทย</a>
	<br>		<div>版权所有 &copy;2008-2012 WaterPark Organization. | <script src="http://s21.cnzz.com/stat.php?id=2982771&web_id=2982771" language="JavaScript"></script>
</div>
		<div>Based on opensource project <a href="http://hustoj.googlecode.com">hustoj</a>.</div>
	</div>
</center>
</body>
</html>
